package com.zsk.shop.common.base;

/**
 * 业务异常
 *
 * @author fengshuonan
 * @date 2017-05-05 23:52
 */
public class BizException extends RuntimeException {
    private Integer code;
    private String errorMessage;

    public BizException(Integer code, String errorMessage) {
        super(errorMessage);
        this.code = code;
        this.errorMessage = errorMessage;
    }
    public BizException(String errorMessage) {
        super(errorMessage);
        this.code = BizExceptionEnum.ERROR.getCode();
        this.errorMessage = errorMessage;
    }

    public BizException(BizExceptionEnum exception) {
        super(exception.getMessage());
        this.code = exception.getCode();
        this.errorMessage = exception.getMessage();
    }

    public Integer getCode() {
        return this.code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getErrorMessage() {
        return this.errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}
